// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity.p_view.WebViews;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewConfiguration;
import android.webkit.WebView;
import com.nnee.p_img.cls_c;
import com.nnee.p_imgex.p_a.cls_a;
import com.nnee.p_pr.p_activity.p_view.f;
import java.lang.reflect.Method;

// Referenced classes of package com.nnee.p_pr.p_activity.p_view.WebViews:
//            WebViewAdapter

public class cls_WebViewV8 extends cls_WebViewAdapter
{

    public WebViewV8(Context context)
    {
        super(context);
        c = -1;
        d = -1;
        e = -1;
        f = -1;
        j = 0F;
        k = 0F;
        l = 0F;
        m = 0F;
        n = 0F;
        o = 0F;
        t = 0;
        u = false;
        v = new Rect();
        w = new Rect();
        x = 0;
        a(context);
    }

    public WebViewV8(Context context, AttributeSet attributeset)
    {
        super(context, attributeset);
        c = -1;
        d = -1;
        e = -1;
        f = -1;
        j = 0F;
        k = 0F;
        l = 0F;
        m = 0F;
        n = 0F;
        o = 0F;
        t = 0;
        u = false;
        v = new Rect();
        w = new Rect();
        x = 0;
        a(context);
    }

    public WebViewV8(Context context, AttributeSet attributeset, int i1)
    {
        super(context, attributeset, i1);
        c = -1;
        d = -1;
        e = -1;
        f = -1;
        j = 0F;
        k = 0F;
        l = 0F;
        m = 0F;
        n = 0F;
        o = 0F;
        t = 0;
        u = false;
        v = new Rect();
        w = new Rect();
        x = 0;
        a(context);
    }

    private void a(Context context)
    {
        int i1 = ViewConfiguration.get(context).getScaledTouchSlop();
        g = i1 * i1;
        x = com.nnee.p_img.cls_c.a(context, 25F);
    }

    private void a(Canvas canvas)
    {
        if(h == null)
            h = getContext().getResources().getDrawable(0x7f020140);
        int i1 = a(c);
        int j1 = a(d);
        int k1 = a(e);
        int l1 = a(f);
        int i2 = i1 - (3 * h.getIntrinsicWidth()) / 4;
        int j2 = d(j1);
        h.setBounds(i2, j2, i2 + h.getIntrinsicWidth(), j2 + h.getIntrinsicHeight());
        v.setEmpty();
        v.set(h.getBounds());
        if(i == null)
            i = getContext().getResources().getDrawable(0x7f020141);
        int k2 = k1 - i.getIntrinsicWidth() / 4;
        int l2 = e(l1);
        i.setBounds(k2, l2, k2 + i.getIntrinsicWidth(), l2 + i.getIntrinsicHeight());
        w.setEmpty();
        w.set(i.getBounds());
        h.draw(canvas);
        i.draw(canvas);
        i.getBounds();
        h.getBounds();
    }

    private int b(int i1)
    {
        return Math.round((float)i1 * (1F / getScale()));
    }

    private boolean b(int i1, int j1, int k1, int l1)
    {
        boolean flag;
        if(j1 == l1 && i1 < k1 || l1 > j1)
            flag = true;
        else
            flag = false;
        return flag;
    }

    private int c(int i1)
    {
        return b(i1 - b());
    }

    private int d(int i1)
    {
        if(i1 < getScrollY())
            i1 = getScrollY();
        return i1;
    }

    private int e(int i1)
    {
        if(i1 < getScrollY())
            i1 = getScrollY();
        return i1;
    }

    private boolean r()
    {
        boolean flag;
        if(c != -1 || d != -1 || e != -1 || f != -1)
            flag = true;
        else
            flag = false;
        return flag;
    }

    int a(int i1)
    {
        return Math.round((float)i1 * getScale());
    }

    public void a()
    {
        emulateShiftHeld();
        f();
    }

    protected int b()
    {
        Method method;
        method = null;
        if(method != null)
            break MISSING_BLOCK_LABEL_23;
        method = android/webkit/WebView.getDeclaredMethod("getTitleHeight", new Class[0]);
        method.setAccessible(true);
        int j1 = ((Integer)method.invoke(this, new Object[0])).intValue();
        int i1 = j1;
_L2:
        return i1;
        Exception exception;
        exception;
        i1 = 0;
        if(true) goto _L2; else goto _L1
_L1:
    }

    public boolean c()
    {
        boolean flag;
        if(n != 0F && o != 0F)
            flag = true;
        else
            flag = false;
        return flag;
    }

    public void d()
    {
        h();
        k();
    }

    public boolean e()
    {
        return m();
    }

    public void k()
    {
        super.k();
        n = 0F;
        o = 0F;
        c = -1;
        d = -1;
        e = -1;
        f = -1;
        t = 0;
    }

    protected void onDraw(Canvas canvas)
    {
        super.onDraw(canvas);
        if(m() && c())
            a(canvas);
    }

    public boolean onTouchEvent(MotionEvent motionevent)
    {
        cls_a a1 = com.nnee.p_imgex.p_a.cls_a.a(motionevent);
        if(!m() || a1.a() != 1) goto _L2; else goto _L1
_L1:
        int i1;
        int j1;
        int k1;
        i1 = a1.b();
        l = a1.c() + (float)getScrollX();
        m = a1.d() + (float)getScrollY();
        float f1 = j - l;
        float f2 = k - m;
        j1 = (int)f1;
        k1 = (int)f2;
        i1;
        JVM INSTR tableswitch 0 3: default 120
    //                   0 128
    //                   1 705
    //                   2 247
    //                   3 705;
           goto _L2 _L3 _L4 _L5 _L4
_L2:
        boolean flag = super.onTouchEvent(motionevent);
_L7:
        return flag;
_L3:
        u = false;
        n = l;
        o = m;
        j = n;
        k = o;
        t = 0;
        if(r())
        {
            if(t == 0)
                t = 1;
            if(v.contains((int)l, (int)m))
                t = 2;
            else
            if(w.contains((int)l, (int)m))
                t = 3;
        }
        flag = true;
        continue; /* Loop/switch isn't completed */
_L5:
        if(j1 * j1 + k1 * k1 >= g)
        {
            u = true;
            if(t == 0)
            {
                c = b((int)n);
                d = c((int)o);
                e = b((int)l);
                f = c((int)m);
                a(c, d, e, f);
            } else
            if(t == 1)
                a(c, d, e, f);
            else
            if(t == 2)
            {
                int i6 = b((int)l);
                int j6 = c((int)m - h.getIntrinsicHeight() / 2);
                if(b(e, f, i6, j6))
                {
                    c = e;
                    d = f;
                    e = i6;
                    f = j6;
                    a(c, d, e, f);
                    t = 3;
                } else
                {
                    c = i6;
                    d = j6;
                    a(c, d, e, f);
                }
            } else
            if(t == 3)
            {
                int k5 = b((int)l);
                int l5 = c((int)m - i.getIntrinsicHeight() / 2);
                if(b(c, d, k5, l5))
                {
                    e = k5;
                    f = l5;
                    a(c, d, e, f);
                } else
                {
                    e = c;
                    f = d;
                    c = k5;
                    d = l5;
                    t = 2;
                    a(c, d, c, d);
                }
            }
            j = l;
            k = m;
            invalidate();
        }
        flag = true;
        continue; /* Loop/switch isn't completed */
_L4:
        int l1 = b((int)l);
        int i2 = c((int)m);
        if(!r())
            break; /* Loop/switch isn't completed */
        if(t == 2 || t == 3)
        {
            int ai[];
            int j3;
            int k3;
            int l3;
            int i4;
            int j4;
            int k4;
            int l4;
            int i5;
            int j5;
            if(u)
            {
                i5 = e;
                j5 = f;
            } else
            {
                i5 = b((int)l);
                j5 = c((int)m);
                e = i5;
                f = j5;
            }
            a(c, d, i5, j5);
        } else
        if(t == 1 && !u)
            if(b(c, d, l1, i2))
            {
                a(c, d, l1, i2);
                e = l1;
                f = i2;
            } else
            {
                a(l1, i2, c, d);
                e = c;
                f = d;
                c = l1;
                d = i2;
            }
_L9:
        j = l;
        k = m;
        invalidate();
        ai = new int[2];
        getLocationInWindow(ai);
        j3 = a(c);
        k3 = a(d);
        l3 = a(e);
        i4 = a(f);
        j4 = (j3 + l3) / 2 - getScrollX();
        k4 = k3 - getScrollY() - x;
        l4 = ((i4 + ai[1]) - getScrollY()) + x;
        a.a(this, j4, k4, l4, 0);
        flag = true;
        if(true) goto _L7; else goto _L6
_L6:
        if(t != 0) goto _L9; else goto _L8
_L8:
        int j2 = b((int)n);
        int k2 = c((int)o);
        int l2 = b((int)l);
        int i3 = c((int)m);
        if(!u)
            if(b(j2, k2, l2, i3))
            {
                c = j2;
                d = k2;
                e = l2;
                f = i3;
            } else
            {
                c = l2;
                d = i3;
                e = j2;
                f = k2;
            }
        a(c, d, e, f);
          goto _L9
    }

    public void onWindowFocusChanged(boolean flag)
    {
        if(m() && c() && a != null)
            flag = true;
        super.onWindowFocusChanged(flag);
    }

    private static final int p = 0;
    private static final int q = 1;
    private static final int r = 2;
    private static final int s = 3;
    private int c;
    private int d;
    private int e;
    private int f;
    private int g;
    private Drawable h;
    private Drawable i;
    private float j;
    private float k;
    private float l;
    private float m;
    private float n;
    private float o;
    private int t;
    private boolean u;
    private Rect v;
    private Rect w;
    private int x;
}
